package cn.wolfcode.wolf2w.business.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 浪兎兎
 * @since 2025-06-16 10:59
 */
@Configuration
public class QuestionConfig {
    @Bean
    public Queue questionQueue() {
        return new Queue("questionQueue", true, false, false, null);
    }
    @Bean
    public DirectExchange questionDirectExchange() {
        return new DirectExchange("questionExchange", true, false, null);
    }
    @Bean
    public Binding questionBinding(Queue questionQueue, Exchange questionDirectExchange) {
        return new Binding("questionQueue", Binding.DestinationType.QUEUE, questionDirectExchange.getName(), "", null);
    }
}
